const express = require('express');
const router = express.Router();
const healthRecordController = require('../controllers/healthRecordController');
const authMiddleware = require('../middlewares/authMiddleware');

// 所有路由需要认证
router.use(authMiddleware);

// 获取健康记录列表
router.get('/', healthRecordController.getRecords);

// 获取单个健康记录详情
router.get('/:id', healthRecordController.getRecordById);

// 创建健康记录
router.post('/', healthRecordController.createRecord);

// 更新健康记录
router.put('/:id', healthRecordController.updateRecord);

// 删除健康记录
router.delete('/:id', healthRecordController.deleteRecord);

module.exports = router; 